<?php
/* @var $this JabatanController */
/* @var $model Jabatan */

$breadcrumbs = array('Struktur Organisasi'=>Yii::app()->createUrl('StrukturOrganisasi/index'));

if(is_array($organisasi))
    $breadcrumbs = array_merge($breadcrumbs, $organisasi);

$breadcrumbs = array_merge($breadcrumbs, array('Jabatan'=>Yii::app()->createUrl('Jabatan/index', array('id_struktur_organisasi'=>$id_struktur_organisasi))));

$this->breadcrumbs  =   $breadcrumbs;


Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('jabatan-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>

<?php $this->widget('ext.widgets.grid.AxGridView', array(
	'id'=>'jabatan-grid',
        'createButtonUrl' => Yii::app()->createUrl(
                                'Jabatan/create', 
                                array(
                                    'id_struktur_organisasi'=>$id_struktur_organisasi
                                    )
                                ),
	'dataProvider'=>$model->search($id_struktur_organisasi),
	'filter'=>$model,
	'columns'=>array(
		'nama',
		array(
			'class'=>'CButtonColumn',
                        'template' => '{update} {delete}',
                        'headerHtmlOptions' => array('class' => 'lastcolumn'),
                        'htmlOptions' => array('class' => 'lastcolumn')
		),
	),
)); ?>